# include <iostream>
# include <string>

using namespace std;

class qiche
{
    public:
        // 1.无参构造函数,又称默认构造函数
        qiche() : yanse("黑"),jiaqian("高"),xinghao("小"),chang(2.5),kuan(2.4),gao(2) {};
        // 2.有参数构造函数，有部分默认值
        qiche(string yanse,string xignhao) : yanse("黑"),jiaqian("高"),xinghao("小"),chang(2.5),kuan(2.4),gao(2) {};
        // 3.拷贝构造函数
        qiche(const qiche & qc) : yanse("黑"),jiaqian("高"),xinghao("小"),chang(2.5),kuan(2.4),gao(2) {};


        void ysi(string yanse) {this->yanse = yanse;}
        string yso() const {return yanse;};
        void jqi(string jiaqian) {this->jiaqian = jiaqian;}
        string jqo() const {return jiaqian;};
        void xhi(string xinghao) {this->xinghao = xinghao;}
        string xho() const {return xinghao;};
        void ci(float chang) {this->chang = chang;}
        float co() const {return chang;};
        void ki(float kuan) {this->kuan = kuan;}
        float ko() const {return kuan;};
        void gi(float gao) {this->gao = gao;}
        float go() const {return gao;};

    private:
        string yanse;
        string jiaqian;
        string xinghao;
        float chang;
        float kuan;
        float gao;
};

int main()
{
    // 无参构造函数实例化
    qiche car1;
    car1.ysi("灰");
    car1.ki(2.6);
    // 有参数构造函数实例化
    qiche car2("红","中");
    car2.jqi("高");
    // 拷贝构造函数实例化
    qiche car3 = qiche(car1);
    car3.xhi("中");
    qiche car4 = qiche(car2);
    car4.jqi("中");

    cout << "第1辆车的信息:" << endl;
    cout << "颜色：" << car1.yso() << "|  价钱：" << car1.jqo() << "|  型号：" << car1.xho() << endl;
    cout << "长：" << car1.co() << " |  宽：" << car1.ko() << " |  高：" << car1.go() << endl;

    cout << "第2辆车的信息:" << endl;
    cout << "颜色：" << car2.yso() << "|  价钱：" << car2.jqo() << "|  型号：" << car2.xho() << endl;
    cout << "长：" << car2.co() << " |  宽：" << car2.ko() << " |  高：" << car2.go() << endl;
    
    cout << "第3辆车的信息:" << endl;
    cout << "颜色：" << car3.yso() << "|  价钱：" << car3.jqo() << "|  型号：" << car3.xho() << endl;
    cout << "长：" << car3.co() << " |  宽：" << car3.ko() << " |  高：" << car3.go() << endl;

    cout << "第4辆车的信息:" << endl;
    cout << "颜色：" << car4.yso() << "|  价钱：" << car4.jqo() << "|  型号：" << car4.xho() << endl;
    cout << "长：" << car4.co() << " |  宽：" << car4.ko() << " |  高：" << car4.go() << endl;
}

